﻿using System;
using System.Web.UI;

using BizElements.BusinessLayer;

namespace BizElements.Web
{
    /// <summary>Represents the simple binding between the field value of an object and the property value of a control.</summary>
    public interface IFieldBinding
    {
        /// <summary>Business object's field.</summary>
        IBindableField Field { get; }

        /// <summary>Bound control to which the field is bound that supports advanced binding features.</summary>
        IBoundControl BoundControl { get; }

        /// <summary>Optional error label control which displays errors associated with the given field. May be embedded in bound control, or it may a stand-alone control.</summary>
        ITextControl ErrorLabel { get; set; }

        /// <summary>Optional caption label control which contains field caption/title. May be embedded in bound control, or it may a stand-alone control.</summary>
        ITextControl CaptionLabel { get; set; }

        /// <summary>Optional control which contains additional control info. May be embedded in bound control, or it may a stand-alone control.</summary>
        ITextControl TooltipLabel { get; set; }

        /// <summary>Optional control that indicates whether a field is required. May be a picture control, a label control with asterisk etc.</summary>
        Control RequiredFieldIndicatorControl { get; set; }
    }   
}